package dev.entao.html

import dev.entao.base.Mimes
import dev.entao.core.HttpContext
import dev.entao.core.render.Render

abstract class TagRender(context: HttpContext) : Render(context) {
    abstract val renderTag: Tag
    open val contentType: String = Mimes.HTML

    override fun onSend() {
        renderTag.scriptsToBottom()
        context.send(contentType) {
            renderTag.toHtml(this)
        }
    }

}